import * as types from './types.js'

const mutations = {
  [types.LOGIN]: (state, data) => {
    state.token = data;
  },
  [types.LOGOUT]: (state) => {
    state.token = '';
  },
  [types.USERINFO]: (state, data) => {
    state.userInfo = data;
  },
  [types.LOGINSTATUS]: (state, bool) => {
    state.loginStatus = bool;
  },
  [types.UPDATEUSERDATA]: (state, bool) => {
    state.updateUserData = bool;
  },
  [types.UPDATESCHEMEDATA]: (state, bool) => {
    state.updateSchemeData = bool;
  },
  [types.UPDATESERVICEDATA]: (state, bool) => {
    state.updateServiceData = bool;
  },
  [types.CURRENTSCHEME]: (state, data) => {
    state.currentScheme = data;
  },
  [types.CURRENTSTREAMURL]: (state, data) => {
    state.currentStreamUrl = data;
  },
  [types.COLLAPSEFLAG]: (state, bool) => {
    state.collapseFlag = bool;
  },
  [types.ISVIDEOFULLSCREEN]: (state, bool) => {
    state.isVideoFullScreen = bool;
  }
}

export default mutations